<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>cinema</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/indexAndCinema.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/indexAndCinema2.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/common.css">
</head>
<body>
<!--header start-->
<header>
    <iframe src="${pageContext.request.contextPath}/top.jsp" frameborder="0" scrolling="no" id="top"></iframe>
</header>

<div class="mian-cur-position"></div>

<div class="mian-cur-nav">

    <c:if test="${movieTemp eq 0}">
        <a href="${pageContext.request.contextPath}/ShowMovies2?movieTemp=0" style="background-color: #0d8ddb;color: #fff;">正在热映</a>
        <a href="${pageContext.request.contextPath}/ShowMovies2?movieTemp=1">即将上映</a>
    </c:if>

    <c:if test="${movieTemp eq 1}">
        <a href="${pageContext.request.contextPath}/ShowMovies2?movieTemp=0">正在热映</a>
        <a href="${pageContext.request.contextPath}/ShowMovies2?movieTemp=1" style="background-color: #0d8ddb;color: #fff;">即将上映</a>
    </c:if>
</div>

<!--product start-->
<section class="index-product">

    <div class="cinema-right">
        <div class="cinema-movie">
            <h5>
                <span> 我们的影厅 </span>
                <a href="#" class="more">全部影厅</a>
            </h5>
            <ul class="freqlist">
                <c:forEach items="${halls}" var="hall">
                    <li class="current">
                        <span class="name">${hall.hallName}</span>
                        <span class="address">${hall.hallDescribe}</span>
                        <span class="buynow"><a href="#">席位:${hall.hallSeats}</a></span>
                    </li>
                </c:forEach>
            </ul>
        </div>
    </div>

    <div class="cinema-left">
        <c:if test="${movieTemp eq 0}">
            <c:forEach items="${movieList}" var="m">
                <div class="movie-card-wrap">
                    <a href="${pageContext.request.contextPath}/getMovieByMovieName?movieName=${m.movieName}" class="movie-card">
                        <div class="movie-card-poster">
                            <img src="${m.movieImg}">
                        </div>
                        <div class="movie-card-name">
                            <span class="bt-l">${m.movieName}</span>
                            <span class="bt-r">${m.movieNum}</span>
                        </div>
                        <div class="movie-card-info">
                            <div class="movie-card-list">
                                <span>导演：${m.movieDirector}</span>
                                <span>主演：${m.movieProtagonist}</span>
                                <span>类型：${m.tempName}</span>
                                <span>片长：${m.movieTime}分钟</span>
                            </div>
                        </div>
                    </a>
                    <a href="getMovieByMovieName?movieName=${m.movieName}" class="movie-card-buy">选座购票</a>
                </div>
            </c:forEach>
        </c:if>

        <c:if test="${movieTemp eq 1}">
            <c:forEach items="${movieList}" var="m">
                <div class="movie-card-wrap">
                    <a href="${pageContext.request.contextPath}/getMovieByMovieName?movieName=${m.movieName}" class="movie-card">
                        <div class="movie-card-poster">
                            <img src="${m.movieImg}">
                        </div>
                        <div class="movie-card-name">
                            <span class="bt-l">${m.movieName}</span>
                            <span class="bt-r">${m.movieNum}</span>
                        </div>
                        <div class="movie-card-info">
                            <div class="movie-card-list">
                                <span>导演：${m.movieDirector}</span>
                                <span>主演：${m.movieProtagonist}</span>
                                <span>类型：${m.tempName}</span>
                                <span>片长：${m.movieTime}分钟</span>
                            </div>
                        </div>
                    </a>
                    <a href="#" class="movie-card-soon">上映时间<fmt:formatDate value="${m.movieRelease}" pattern="yyyy-MM-dd"/></a>
                </div>
            </c:forEach>
        </c:if>
    </div>
</section>
<!--product end-->


<!--footer start-->
    <iframe src="${pageContext.request.contextPath}/foot.jsp" frameborder="0" scrolling="no" id="foot"></iframe>
</body>
</html>